package cz.czu.pef.DataModelling.domainObjects;

import java.util.*;

public class MachineType extends IdObjectImpl implements IdObject
{
  private static final long serialVersionUID = 6973032941650780904L;

  /*
	 * Entity attributes
	 */
	private String machineTypeName;
	private String machineTypeDescription;

	/*
	 * Relations
	 */
	private Set<Machinery> machinery;

	public MachineType()
	{
		super();
	}

	// TODO: Connect with TrainingType/RoleType???
	public MachineType(String machineTypeName, String machineTypeDescription)
	{
		super();
		this.machineTypeName = machineTypeName;
		this.machineTypeDescription = machineTypeDescription;
	}

	public String getMachineTypeName()
	{
		return machineTypeName;
	}
	
	public void setMachineTypeName(String machineTypeName)
	{
		this.machineTypeName = machineTypeName;
	}
	
	public String getMachineTypeDescription()
	{
		return machineTypeDescription;
	}
	
	public void setMachineTypeDescription(String machineTypeDescription)
	{
		this.machineTypeDescription = machineTypeDescription;
	}

	public Set<Machinery> getMachinery()
	{
		return machinery;
	}

	public List<Machinery> getMachineryAsList()
	{
		return new ArrayList<Machinery>(getMachinery());
	}

	
  public void setMachinery(Set<Machinery> machinery)
  {
    this.machinery = machinery;
  }

  public String toString()
	{
		StringBuilder builder = new StringBuilder();
		builder.append("MachineType [machineTypeName=");
		builder.append(machineTypeName);
		builder.append(", machineTypeDescription=");
		builder.append(machineTypeDescription);
		builder.append(", toString()=");
		builder.append(super.toString());
		builder.append("]");
		return builder.toString();
	}
}
